Release 10.1A: OpenEdge Development:
Web Services


Processing the schema and data for an output TABLE-HANDLE parameter

This example shows how you might process the data from an output TABLE-HANDLE parameter by walking the output XML Schema and XML data to create a .NET DataSet and bind the DataSet to a .NET DataGrid:

Dim schemaEl As XmlElement  
Dim dataEl As XmlElement 
Dim node As XmlNode 
Dim type As XmlNodeType 
... 
' Extract the schema and data elements from the output 
schemaEl = Nothing 
dataEl = Nothing 
For i = 0 To dynTTEl.ChildNodes.Count - 1 
   node = dynTTEl.ChildNodes( i ) 
   type = node.NodeType 
   If type = System.Xml.XmlNodeType.Element Then 
      If schemaEl Is Nothing Then 
         schemaEl = node 
      ElseIf dataEl Is Nothing Then 
         dataEl = node 
      Else 
         ‘Too many elements, something is wrong 
      End If 
   End If 
Next i 
' Load schema and data into a System.Data.DataSet, then bind to a 
‘ System.Windows.Forms.DataGrid 
mySchemaReader = New System.Xml.XmlNodeReader(schemaEl) 
myDataReader = New System.Xml.XmlNodeReader(dataEl) 
myDataSet.ReadXmlSchema(mySchemaReader) 
myDataSet.ReadXml(myDataReader) 
' Load myDataGrid with the output from DynTT 
myDataGrid.SetDataBinding(myDataSet, "Item") 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095